package com.chen.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.chen.entity.Account;

import java.math.BigDecimal;

public interface IAccount extends IService<Account> {
    /**
     * 向账户转入资金
     * @param account 转入账户
     * @param amount    转入资金
     */
    void transferInto(int account, BigDecimal amount) throws Exception;

    /**
     * 从账户转出资金
     * @param account
     * @param amount
     */
    void transferOut(int account, BigDecimal amount) throws Exception;

    /**
     * 模拟转入出现异常
     * @param accountId
     * @param amount
     */
    void transferIntoWithException(int accountId, BigDecimal amount);
}
